function BeatPicker(t) { var e = {}; jQuery.extend(!0, e, this, t), jQuery.extend(this, e), this.constructor() } BeatPicker.prototype = { dateInputNode: null, pickerNode: null, daysSimple: "Su Mo Tu We Th Fr Sa".split(" "), daysFull: [], monthsSimple: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), monthsFull: "January February March April May June July August September October November December".split(" "), startDate: new Date, currentDate: new Date, dateFormat: { separator: "-", format: ["YYYY", "MM", "DD"] }, modules: { header: !0, footer: !0, daysOfTheWeek: !0, navBar: !0, today: !0, gotoDate: !0, icon: !0, clear: !0 }, selectionRule: { single: !0, range: !1, rangeDisableSelect: !1 }, className: { beatPicker: "beatpicker", header: "header", footer: "footer", days: "days", inputParent: "input-parent", headerNavBarParent: "header-navbar-container", headerNavBarButton: "header-navbar-button", weekDaysAliasCell: "week-alias-cell", weekDaysAliasCellParent: "week-alias-cell-parent", input: "beatpicker-input", inputTo: "beatpicker-input-to", betweenRange: "between-range", inputFrom: "beatpicker-input-from", daysCell: "days-cell", monthsCell: "months-cell", yearsCell: "years-cell", yearsRangeCell: "years-range-cell", daysCellParent: "days-cell-parent", todayButton: "today", todayBox: "today-box", gotoDateParent: "goto-date-parent", gotoDateInput: "goto-date", gotoDateButton: "goto-date-button", selected: "selected", disabled: "disabled", clear: "beatpicker-clear", _inner: { beatPicker: "beatpicker", inputContainer: "input-container", cell: "cell", cellM: "cell-months", cellY: "cell-years", cellYR: "cell-years-range", cellParent: "cell-parent", headerNavBar: "main-nav", headerNavBarBtn: "nav-btn", headerNavBarBtnNext: "next", headerNavBarBtnPrev: "prev", inputNode: "beatpicker-inputnode", dateInputTo: "beatpicker-inputnode-to", betweenDateNode: "between-range", dateInputFrom: "beatpicker-inputnode-from", headerNavBarBtnMonthIndicator: "current-indicator", notNotable: "not-notable", todayButton: "today", gotoDateInput: "date-input", gotoDateButton: "date-input-button", gotoDateContainer: "goto-date-container", footer: "footer", todayInGrid: "notable-today", selectedDate: "selected-date", disableDate: "date-disabled", clearButton: "beatpicker-clearButton", defaultButton: "button" } }, view: { display: "days", alwaysVisible: !1, position: ["bottom", "left"], showOn: "click", hideOn: "click", isInputIsReadonly: !0, iconImage: "data:image/png;base64,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" }, labels: { today: "Today", gotoDateInput: "YYYY/MM/DD", gotoDateButton: "GO", clearButton: "Clear" }, events: { select: "select", change: "change", show: "show", hide: "hide", clear: "clear" }, disablingRules: [], a: null, b: null, c: [], d: [], e: [], f: [], g: "MM", h: "YYYY", i: "DD", j: null, k: null, l: null, m: null, n: null, o: null, p: null, q: null, r: null, s: null, t: !1, u: !1, v: !0, w: [], x: { days: "days", months: "months", years: "years" }, y: { briefDate: "BRIEFDATE", yearName: "YEARNAME", yearsRange: "YEARSRANGE" }, z: { "<": "<", ">": ">", "*": "*" }, aa: {}, constructor: function() { !window.beatPickerList && (window.beatPickerList = []), window.beatPickerList.push(this), this.bv(), this.ab(this.startDate), this.bk(), this.ac(); var t = this.k = this.pickerNode = this.ad(); if (this.ar(), this.modules.header) { var e = this.ah(); t.prepend(e) } if (this.modules.navBar && e && t.append(this.ag(e)), t.append(this.am()), this.modules.footer) { var i = this.aj(); t.append(i) } this.modules.footer && this.modules.today && this.ak(i), this.modules.footer && this.modules.gotoDate && this.al(i), this.modules.icon && this.af(), this.modules.clear && this.ae(), this.bz(), this.view.alwaysVisible && this.show() }, ab: function(t) { "string" == typeof t ? this.startDate = new Date(t) : t instanceof Array ? this.startDate = new Date(this.startDate[0], this.startDate[1] - 1, this.startDate[2]) : t instanceof Object && (this.startDate = t), this.currentDate = this.startDate }, ac: function() { this.dateInputNode.after(this.a = this.bw("div", { class: this.bx(this.className.inputParent, this.className._inner.inputContainer) })), this.dateInputNode.appendTo(this.a).addClass(this.bx(this.className.input, this.className._inner.inputNode)), this.selectionRule.range && this.dateInputNode.addClass(this.bx(this.className.inputFrom, this.className._inner.dateInputFrom)).after(this.b = this.bw("input", { type: "text", class: this.bx(this.className.inputTo, this.className._inner.dateInputTo, this.className.input, this.className._inner.inputNode) }, this.a)), this.view.isInputIsReadonly && this.dateInputNode.add(this.selectionRule.range ? this.b : {}).attr("readonly", !0) }, ad: function() { return this.bw("div", { class: this.bx(this.className.beatPicker, this.className._inner.beatPicker) }, this.view.alwaysVisible ? this.a : jQuery("body")) }, ae: function() { var t = this, e = this.bw("button", { class: this.bx(this.className.clear, this.className._inner.clearButton, this.className._inner.defaultButton), type: "button" }, null, this.labels.clearButton); e.on("click", function() { if (t.m || t.n || t.q) { var e = { timeStamp: (new Date).getTime() }; t.selectionRule.range ? jQuery.extend(e, { startDate: t.n, startDateString: t.n ? t.bf(t.n) : null, endDate: t.q, endDateString: t.q ? t.bf(t.q) : null }) : t.selectionRule.single && jQuery.extend(e, { date: t.m, string: t.bf(t.m) }), t.cq(t.events.clear, e), t.reset() } }), this.a.append(e) }, af: function() { this.dateInputNode.add(this.b).css("background-image", "url('" + this.view.iconImage + "')") }, ag: function(t) { var e = this; t = this.bw("div", { class: this.bx(this.className.headerNavBarParent, this.className._inner.headerNavBar) }, t, "", !0), this.bw("a", { class: this.bx(this.className.headerNavBarButton, this.className._inner.headerNavBarBtn, this.className._inner.headerNavBarBtnNext, this.className._inner.defaultButton) }, t, ">").on("click", function() { e.cb(!1) }); var i = this._currentIndicator = this.bw("a", { class: this.bx(this.className.headerNavBarButton, this.className._inner.headerNavBarBtn, this.className._inner.headerNavBarBtnMonthIndicator, this.className._inner.defaultButton) }, t).on("click", function() { e.cf(!0) }); this.av(i, this.y.briefDate), this.bw("a", { class: this.bx(this.className.headerNavBarButton, this.className._inner.headerNavBarBtn, this.className._inner.headerNavBarBtnPrev, this.className._inner.defaultButton) }, t, "<").on("click", function(t) { e.cb(!0) }) }, ah: function() { var t = this.bw("div", { class: this.className.header }); return this.modules.daysOfTheWeek && t.append(this.ai(this.daysSimple)), t }, ai: function(t) { if (t instanceof Array) { var e = this._weekDayParent = this.bw("ul", { class: this.className.weekDaysAliasCellParent + " " + this.className._inner.cellParent }); return this.forEach(t, function(t, i) { this.bw("li", { class: this.className.weekDaysAliasCell + " " + this.className._inner.cell }, e, i) }, this), e } }, aj: function() { return this._footerNode = this.bw("div", { class: this.bx(this.className.footer, this.className._inner.footer) }) }, ak: function(t) { var e = this; this.bw("a", { class: this.bx(this.className.todayButton, this.className._inner.todayButton, this.className._inner.defaultButton) }, t, this.labels.today).on("click", function(t) { e.currentDate = new Date, e.ax(e.currentDate) }) }, al: function(t) { var e = this; t = this.bw("div", { class: this.bx(this.className.gotoDateParent, this.className._inner.gotoDateContainer) }, t); var i = this.bw("input", { type: "text", class: this.bx(this.className.gotoDateInput, this.className._inner.gotoDateInput), placeholder: this.labels.gotoDateInput }, t).on("keydown", function(t) { 13 === t.keyCode && e.cg(i) }); this.bw("a", { type: "button", class: this.bx(this.className.gotoDateButton, this.className._inner.gotoDateButton, this.className._inner.defaultButton) }, t, this.labels.gotoDateButton).on("click", function() { e.cg(i) }) }, am: function() { var t = this; if (this.cq(this.events.change, { date: this.currentDate, timeStamp: (new Date).getTime() }), !this._daysBody) var e = this._daysBody = this.bw("div", { class: this.className.days }); if (this._daysCellParent && this._daysCellParent.empty(), this.c.length = this.d.length = this.e.length = 0, !this._daysCellParent) var i = this._daysCellParent = this.bw("ul", { class: this.className.daysCellParent + " " + this.className._inner.cellParent }, this._daysBody); if (this.view.display === this.x.days) { for (this._weekDayParent && this._weekDayParent.show(), this._daysBody.find(i).empty(), i = 0; 42 > i; i++) { var s = this.bw("li", { class: this.className.daysCell + " " + this.className._inner.cell }, this._daysCellParent); this.c.push(s); var a = this.bb(i, s); s.data("click-behaviour", a.isNextMonth), s.on("click", function(e) { var i = jQuery(this).data("click-behaviour"); !jQuery(this).data("disabled") && t.au(e), "not-avail" !== i && t.aw(i ? 1 : -1, t.g) }), s.text(a.day), this.selectionRule.single && this.ba(this.c[i].data("date"), this.c[i]) } this.az(new Date), this.selectionRule.range && this.co(this.n, this.q) } else this.view.display === this.x.months ? (this.an(), this.av(this._currentIndicator, this.y.yearName)) : this.view.display === this.x.years && (this.av(this._currentIndicator, this.y.yearsRange), this.ao()); return e }, an: function() { var t = this; this._weekDayParent && this._weekDayParent.hide(); for (var e = 0; 11 >= e; e++) { var i = this.bw("li", { class: this.bx(this.className.monthsCell, this.className._inner.cell, this.className._inner.cellM) }, this._daysCellParent, this.monthsSimple[e]).on("click", function() { t.view.display = t.x.months, t.cf(!1, jQuery(this).data("date")) }); this.d.push(i), i.data("date", this.cc(e, !0)) } }, ao: function() { var t = this; this._weekDayParent && this._weekDayParent.hide(); for (var e = this.ce(this.currentDate.getFullYear()), i = 0; 11 >= i; i++) { var s = this.bw("li", { class: this.bx(this.className.yearsCell, this.className._inner.cell, this.className._inner.cellY) }, this._daysCellParent, e[i]).on("click", function() { t.view.display = t.x.years, t.cf(!1, jQuery(this).data("date")) }); this.e.push(s), s.data("date", this.cc(e[i], !1)) } }, ap: function() { for (var t in this.d) this.d[t].data("date", this.cc(t, !0)) }, aq: function() { var t, e = this.ce(this.currentDate.getFullYear()); for (t in this.e) this.e[t].data("date", this.cc(e[t], !1)), this.e[t].text("").text(e[t]) }, ar: function() { var t = this; this.view.alwaysVisible || (t.k.css("display", "none"), jQuery("html,body").on(this.view.hideOn, function(e) { !t.v && t.hide() }), this.k.on("click", function(t) { t.stopPropagation() })); var e = this.dateInputNode; this.selectionRule.range && (e = this.dateInputNode.add(this.b)), e.on(this.view.showOn, function(e) { if (e.stopPropagation(), t.v || t.selectionRule.range) { var i = jQuery.grep(window.beatPickerList, function(e, i) { return e !== t && !e.view.alwaysVisible }); t.forEach(i, function(t, e) { !e.isHide() && e.hide() }, t), t.show(e) } }) }, as: function(t, e) { var i = this.at(t, e); this.k.css({ left: i.x, top: i.y }) }, at: function(t, e) { var i = this.by(t), s = e && e.x || this.view.position[0], a = e && e.y || this.view.position[1], n = this, r = { rightTop: function() { s = this._rightCommon(), a = this._topCommon() - n.k.outerHeight() }, rightMiddle: function() { s = this._rightCommon(), a = this._topCommon() - n.k.outerHeight() / 2 + n.dateInputNode.outerHeight() / 2 }, rightBottom: function() { s = this._rightCommon(), a = this._topCommon() }, leftTop: function() { s = this._leftCommon(), a = this._topCommon() - n.k.outerHeight() }, leftMiddle: function() { s = this._leftCommon(), a = this._topCommon() - n.k.outerHeight() / 2 + n.dateInputNode.outerHeight() / 2 }, leftBottom: function() { s = this._leftCommon(), a = this._topCommon() }, bottomRight: function() { a = this._bottomCommon(), s = this._rightCommon() - n.k.outerWidth() }, bottomMiddle: function() { a = this._bottomCommon(), s = this._leftCommon() + i.width / 2 + n.k.width() / 2 }, bottomLeft: function() { a = this._bottomCommon(), s = this._leftCommon() + n.k.outerWidth() }, topRight: function() { a = this._topCommon() - n.k.outerHeight(), s = this._rightCommon() - n.k.outerWidth() }, topMiddle: function() { a = this._topCommon() - n.k.outerHeight(), s = this._leftCommon() + i.width / 2 + n.k.width() / 2 }, topLeft: function() { a = this._topCommon() - n.k.outerHeight(), s = this._leftCommon() + n.k.outerWidth() }, left: function() { s = this._leftCommon(), a = this._topAutoCommon() }, top: function() { a = this._topCommon() - n.k.outerHeight(), s = this._leftAutoCommon() }, right: function() { s = this._rightCommon(), a = this._topAutoCommon() }, bottom: function() { a = this._bottomCommon(), s = this._leftAutoCommon() }, "**": function() { a = this._topAutoCommon(), s = this._leftAutoCommon() }, customAdjustment: function() { a = i.y + +a, s = i.x + +s }, _rightCommon: function() { return i.x + i.width }, _bottomCommon: function() { return i.y + i.height }, _leftCommon: function() { return i.x - n.k.outerWidth() }, _topCommon: function() { return i.y }, _topAutoCommon: function() { var t; return +(this._topCommon() + n.k.outerHeight() - jQuery(window).scrollTop()) > jQuery(window).height() ? (t = jQuery(window).height() + jQuery(window).scrollTop() - n.k.outerHeight(), jQuery(window).height() < n.k.outerHeight() && (t = jQuery(window).scrollTop())) : t = this._topCommon(), Math.floor(t) }, _leftAutoCommon: function() { var t; return (t = this._leftCommon() + n.k.outerWidth()) + n.k.outerWidth() > jQuery(window).width() && (0 >= (t = jQuery(window).width() - n.k.outerWidth()) && (t = jQuery(window).scrollLeft())), Math.floor(t) } }; if (isNaN(s) && isNaN(a)) { var h = s, o = a.substr(0, 1).toUpperCase() + this.view.position[1].substr(1); "**" === (h = "*" === s && "*" === a ? "**" : "*" == a ? h : h + o) && this.view.alwaysVisible && (h = "bottomLeft"), h in r && r[h]() } else isNaN(s) || isNaN(a) || r.customAdjustment(); return { y: a, x: s } }, au: function(t) { var e = (t = jQuery(t.currentTarget || t.originalEvent.currentTarget)).data("date"), i = this.bf(e), s = {}; this.selectionRule.single ? (this.l && this.cl(this.l), this.m = new Date(e.getTime()), this.dateInputNode.val(i), this.l = t, !this.view.alwaysVisible && this.hide(), this.ck(this.l), s = { dateObj: e, string: i, timeStamp: (new Date).getDate() }, this.cq(this.events.select, s)) : this.selectionRule.range && (this.t ? (this.o = e, this.bi(!0)) : this.u && (this.r = e, this.bi(!1)), this.selectionRule.rangeDisableSelect || !this.br(this.o, this.r, this.t) ? (s = { fromDate: this.n, toDate: this.q, timeStamp: (new Date).getTime() }, this.t ? (this.p && this.cl(this.p), this.p = t, this.n = this.o = e, jQuery.extend(s, { fromDate: this.n }), this.cq(this.events.select, s), this.dateInputNode.val(i), this.show({ currentTarget: this.b[0] })) : this.u && (this.s && this.cl(this.s), this.s = t, this.q = this.r = e, jQuery.extend(s, { toDate: this.q }), this.cq(this.events.select, s), this.b.val(i), this.cd() && !this.n && this.show(this.dateInputNode)), this.ck(t), this.n && this.q && this.co(this.n, this.q)) : (this.r = this.q ? new Date(this.q.getTime()) : null, this.o = this.n ? new Date(this.n.getTime()) : null)) }, av: function(t, e) { if (t) if (e === this.y.briefDate)(t || this._currentIndicator).text(this.monthsFull[this.currentDate.getMonth()] + " " + this.currentDate.getFullYear()); else if (e === this.y.yearName)(t || this._currentIndicator).text(this.currentDate.getFullYear()); else if (e === this.y.yearsRange) { var i = this.ce(this.currentDate.getFullYear()); (t || this._currentIndicator).text(i[0] + "-" + i[i.length - 1]) } }, aw: function(t, e, i) { var s = { YYYY: "FullYear", MM: "Month", DD: "Date" }, a = this.currentDate["get" + s[e]](), n = new Date(this.currentDate.getTime()); 31 === this.currentDate.getDate() && e === this.g && this.currentDate.setDate(28), this.currentDate["set" + s[e]](a + t), 0 <= this.currentDate.getFullYear() ? this.ay(i) : this.currentDate = new Date(n.getTime()) }, ax: function(t, e, i) { this.currentDate = new Date(t.getTime()), this.ay(i) }, ay: function(t) { if (!t && this.cq(this.events.change, { date: this.currentDate, string: this.bf(this.currentDate), timeStamp: (new Date).getTime() }), this.view.display === this.x.days) { for (var e in this.l && this.cl(this.l), this.selectionRule.range && (this.t ? this.q && this.bg(this.q, !1) : this.u && this.n && this.bg(this.n, !0)), this.c) t = this.bb(+e, this.c[e]), this.c[e].data("click-behaviour", t.isNextMonth), jQuery(this.c[e]).text("").text(t.day), this.selectionRule.single && this.ba(this.c[e].data("date"), this.c[e]); this.selectionRule.range && this.co(this.n, this.q), this.az(new Date), this.av(this._currentIndicator, this.y.briefDate) } else this.view.display === this.x.months ? (this.ap(), this.av(this._currentIndicator, this.y.yearName)) : this.view.display === this.x.years && (this.aq(), this.av(this._currentIndicator, this.y.yearsRange)) }, az: function(t) { if (this.modules.today) for (var e in t = t || this.currentDate, this.j && this.j.removeClass(this.className._inner.todayInGrid).removeClass(this.className.todayBox), this.c) this.ch(this.c[e].data("date"), t) && (this.j = this.c[e], jQuery(this.c[e]).addClass(this.className._inner.todayInGrid).addClass(this.className.todayBox)) }, ba: function(t, e) { this.m && this.ch(t, this.m) && (this.l = e, this.ck(e)) }, bb: function(t, e) { var i = new Date(this.currentDate.getTime()); e.removeClass(this.className._inner.notNotable); var s = this.bd(i), a = this.bc(i), n = !1; return t >= a.firstDay && t < s.nowMonthDays + a.firstDay ? (t = t - a.firstDay + 1, n = "not-avail", i.getDate() == t - 1 && 0 == i.getHours() && 2 == a.month ? i = new Date(a.year, a.month, a.date + 1, 2) : i.setDate(t)) : t < a.firstDay ? (s = s.prevMonthDays - (a.firstDay - t - 1), i.setMonth(i.getMonth() - 1), i.setDate(s), e.addClass(this.className._inner.notNotable), t = s) : t >= s.nowMonthDays + a.firstDay && (s = t + 1 - (a.firstDay + s.nowMonthDays), i.setMonth(i.getMonth() + 1), i.setDate(s), e.addClass(this.className._inner.notNotable), n = !0, t = s), e.data("date", i), this.bq(i, e), { day: t, isNextMonth: n } }, bc: function(t) { var e = new Date(t.getTime()); return e.setDate(1), { firstDay: e.getDay(), date: t.getDate(), day: t.getDay(), month: t.getMonth(), year: t.getFullYear() } }, bd: function(t) { var e = t.getMonth(); return t = t.getFullYear(), { prevMonthDays: this.be(0 > e - 1 ? 11 : e - 1, 0 > e - 1 ? t - 1 : t), nowMonthDays: this.be(e, t), nextMonthDays: this.be(11 < e + 1 ? 1 : e, 11 < e + 1 ? t + 1 : t) } }, be: function(t, e) { return /8|3|5|10/.test(t) ? 30 : 1 != t ? 31 : 0 == e % 4 && 0 != e % 100 || 0 == e % 400 ? 29 : 28 }, bf: function(t) { var e = t.getDate(), i = t.getMonth() + 1; t = t.getFullYear(); var s = "NM" == this.dateFormat.format[0] || "NM" == this.dateFormat.format[1] || "NM" == this.dateFormat.format[2], a = { DD: 10 <= +e || s ? +e : "0" + e, MM: 10 <= i ? i : "0" + i, YYYY: t, YY: String(t).substr(2), NM: this.monthsFull[+i - 1] }, n = this.dateFormat.separator, r = ""; return this.forEach(this.dateFormat.format, function(t, e) { a[e] && (r += a[e] + (2 > t ? n : "")) }, this), r }, bg: function(t, e) { var i, s = this.bl(t, t); for (i in this.c) { var a = this.c[i], n = a.data("date"); this.cm(a), a.data("disabled", !1), n = this.bc(n), this[e ? "bt" : "bs"](n, s, !0) && (this.cn(a), a.data("disabled", !0)) } }, bh: function() { for (var t in this.c) { var e = this.c[t].data("date"); this.bq(e, this.c[t]) } }, bi: function(t) { "BOTH" === t ? (delete this.w[this._lastIndexOfFromDate], delete this.w[this._lastIndexOfToDate]) : t ? delete this.w[this._lastIndexOfFromDate] : delete this.w[this._lastIndexOfToDate] }, bj: function(t, e, i) { (t = this.bl(t, e)) && (this.bi(i), this.w.unshift(t), i ? (0 === this._lastIndexOfToDate && (this._lastIndexOfToDate = 1), this._lastIndexOfFromDate = 0) : (0 === this._lastIndexOfFromDate && (this._lastIndexOfFromDate = 1), this._lastIndexOfToDate = 0)) }, bk: function() { for (var t in this.disablingRules) { var e = this.disablingRules[t], i = e.from, s = e.to; if (isNaN(Date.parse(e.from)) && !this.bn(i)) break; if (isNaN(Date.parse(e.to)) && !s instanceof Array && !s in this.z) break; (e = this.bl(e.from, e.to)) && this.w.push(e) } }, bl: function(t, e) { var i = !isNaN(Date.parse(t)) || t instanceof Date, s = !isNaN(Date.parse(e)) || e instanceof Date; this.cs(t), this.cs(e), this.ct(t), this.ct(e); var a = { fromDate: null, toDate: null, fromMonth: null, toMonth: null, fromYear: null, toYear: null }; return i && s ? (i = this.bc(new Date(t)), s = this.bc(new Date(e))) : (i = i ? this.bc(new Date(t)) : this.bm(t), s = s ? this.bc(new Date(e)) : this.bm(e)), a.fromDate = i.date, a.fromMonth = i.month, a.fromYear = i.year, a.toDate = s.date, a.toMonth = s.month, a.toYear = s.year, a }, bm: function(t) { var e = {}; return t instanceof Array && (e.date = t[2], e.month = isNaN(+t[1]) ? t[1] : +t[1] - 1, e.year = t[0]), "string" == typeof t && (e.date = e.month = e.year = t), e }, bn: function(t) { if (!t instanceof Array) return !1; var e, i = !1; for (e in t) t[e] in this.z && (i = !0); return i }, bo: function(t, e) { var i, s = this, a = { ">": this.bs, "<": this.bt, "*": function(i, a) { if (s.bs(t, e, !0) || "*" === e.fromYear) return "*" === a.toYear ? "*" === a.toMonth ? "*" === a.toDate || i.date == a.toDate : "*" === a.toDate ? i.month == a.toMonth : i.month == a.toMonth && i.date == a.toDate : "*" === a.toMonth ? "*" === a.toDate ? i.year == a.toYear : i.year == a.toYear && i.date == a.toDate : "*" === a.toDate ? i.year == a.toYear && i.month == a.toMonth : i.year == a.toYear && i.month == a.toMonth && i.date == a.toDate } }; for (i in e) { if (">" === e[i] || "<" === e[i]) return a[e.toDate](t, e, !0); if ("*" === e[i]) return a[e[i]](t, e) } }, bp: function(t) { t = this.bc(t); var e, i = !1; for (e in this.w) { var s = this.w[e]; if (s && (i = this.bn(s) ? this.bo(t, s) : this.bs(t, s, !0) && this.bt(t, s, !1)), i) break } return i }, bq: function(t, e) { this.bp(t) ? (e.data("disabled", !0), this.cn(e)) : (e.data("disabled", !1), this.cm(e)) }, br: function(t, e, i) { if (t && e) for (var s in e = new Date(e.getTime()), t = new Date(t.getTime()), i ? e.setDate(e.getDate() - 1) : t.setDate(t.getDate() + 1), i = this.ci(t, e)) if (this.bp(i[s])) return !0; return !1 }, bs: function(t, e, i) { return i = i ? "from" : "to", t.year > e[i + "Year"] || t.year == e[i + "Year"] && t.month > e[i + "Month"] || t.date >= e[i + "Date"] && e[i + "Year"] == t.year && e[i + "Month"] == t.month }, bt: function(t, e, i) { return i = i ? "from" : "to", t.year < e[i + "Year"] || t.year == e[i + "Year"] && t.month < e[i + "Month"] || t.date <= e[i + "Date"] && e[i + "Year"] == t.year && e[i + "Month"] == t.month }, bu: function(t, e, i) { return i = i ? "from" : "to", t.date == e[i + "Date"] && e[i + "Year"] == t.year && e[i + "Month"] == t.month }, bv: function() { this.forEach = function(t, e, i) { jQuery.each(t, function(t, s) { e.call(i || this, t, s) }) } }, bw: function(t, e, i, s, a) { return (t = jQuery(-1 === t.indexOf("<") ? "<" + t + ">" : t)).attr(e)[t[0].value ? "val" : "text"](s)[i ? a ? "prependTo" : "appendTo" : "andSelf"](i || void 0) }, bx: function() { var t = "", e = arguments; return this.forEach(arguments, function(i, s) { t += s + (i !== e.length - 1 && 1 !== e.length ? " " : "") }, this), t }, by: function(t) { var e = jQuery(window).outerHeight(), i = jQuery(window).outerWidth(), s = jQuery(t)[this.view.alwaysVisible ? "position" : "offset"]().top, a = jQuery(t)[this.view.alwaysVisible ? "position" : "offset"]().left; return { height: jQuery(t).outerHeight(), width: t = jQuery(t).outerWidth(), x: a, y: s, winHeight: e, winWidth: i } }, bz: function() { var t = this; this.on(this.events.hide, function(e) { (t.m || t.n) && t.ax(t.m || t.n, !0), t.az(new Date) }) }, ca: function(t) { this.u = !1, this.t = !0, t && t.currentTarget === this.b[0] ? (this.u = !0, this.t = !1, this.bi(!1), this.n && this.bj(this.n, "<", !0)) : (delete this.w[this._lastIndexOfFromDate], this.q && this.bj(this.q, ">", !1)), this.bh(), this.as(t && this.selectionRule.range && t.currentTarget === this.b[0] ? this.b[0] : this.dateInputNode) }, cb: function(t) { this.view.display === this.x.days ? this.aw(t ? -1 : 1, this.g) : this.view.display === this.x.months ? this.aw(t ? -1 : 1, this.h) : this.view.display === this.x.years && this.aw(t ? -12 : 12, this.h) }, cc: function(t, e) { var i = new Date; return i.setMonth(e), e ? (i.setFullYear(this.currentDate.getFullYear()), i.setMonth(t)) : (i.setFullYear(t), i.setMonth(1)), i.setDate(1), i }, cd: function() { return !this.b.val() || !this.dateInputNode.val() || (!this.view.alwaysVisible && this.hide(), this.view.alwaysVisible) }, ce: function(t) { t = 12 * Math.floor(t / 12) + 1; var e = []; e.push(t); for (var i = 1; 11 >= i; i++) e.push(t + i); return e }, cf: function(t, e) { var i = this, s = { 1: function() { i.av(i._currentIndicator, i.y.briefDate), i.view.display = i.x.days }, 2: function() { i.av(i._currentIndicator, i.y.yearName), i.view.display = i.x.months }, 3: function() { i.av(i._currentIndicator, i.y.yearsRange), i.view.display = i.x.years } }, a = { days: 1, months: 2, years: 3, yearsRange: 4 }; (s = t ? s[a[this.view.display] + 1] : s[a[this.view.display] - 1]) && (this.currentDate = e ? new Date(e.getTime()) : this.currentDate, s(), this.am()) }, cg: function(t) { if (t.val()) { t = t.val().split("/"); var e = new Date; 1 === t.length ? (this.view.display = this.x.years, e.setFullYear(t[0])) : 2 === t.length ? (this.view.display = this.x.months, e.setFullYear(t[0]), e.setMonth(t[1])) : 3 === t.length && (this.view.display = this.x.days, e.setFullYear(t[0]), e.setMonth(t[1]), e.setDate(t[2])), this.currentDate = new Date(e.getTime()), this.am(e) } }, ch: function(t, e) { return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate() }, ci: function(t, e) { for (var i = [], s = t; s <= e;) i.push(new Date(s)), s = this.cj(s, 1); return i }, cj: function(t, e) { var i = new Date(t.valueOf()); return i.setDate(i.getDate() + e), i }, ck: function(t) { t.addClass(this.className.selected + " " + this.className._inner.selectedDate) }, cl: function(t) { t.removeClass(this.className.selected + " " + this.className._inner.selectedDate) }, cm: function(t) { t.removeClass(this.className.disabled + " " + this.className._inner.disableDate) }, cn: function(t) { t.addClass(this.className.disabled + " " + this.className._inner.disableDate) }, co: function(t, e) { if (t && e) var i = this.bl(t, e); for (var s in this.c) { var a = jQuery(this.c[s]), n = a.data("date"); this.cl(a), t && e ? (a.removeClass(this.className.betweenRange + " " + this.className._inner.betweenDateNode), n = this.bc(n), this.bu(n, i, !0) || this.bu(n, i, !1) ? this.ck(a) : this.bs(n, i, !0) && this.bt(n, i, !1) && a.addClass(this.className.betweenRange + " " + this.className._inner.betweenDateNode)) : t ? this.ch(this.n, n) && this.ck(a) : e && this.ch(this.q, n) && this.ck(a) } }, cp: function() { for (var t in this.c) this.c[t].removeClass(this.className.betweenRange + " " + this.className._inner.betweenDateNode) }, cq: function(t, e) { var i = this.aa[t]; i && this.forEach(i, function(t, i) { i.func.call(i.scope, e) }, this) }, cr: function(t) { return t instanceof Date }, cs: function(t) { return t instanceof Array }, ct: function(t) { return "string" == typeof t }, on: function(t, e, i) { t && "string" == typeof t && e && (!this.aa[t] && (this.aa[t] = []), this.aa[t].push({ func: e, scope: i || this.k })) }, show: function(t) { this.k.css("display", ""), this.v = !1, !this.view.alwaysVisible && this.cq(this.events.show), this.selectionRule.range ? this.ca(t) : this.as(this.dateInputNode) }, hide: function() { this.k.css("display", "none"), this.v = !0, this.cq(this.events.hide) }, today: function() { this.currentDate = new Date, this.ax(self.currentDate) }, reset: function() { this.selectionRule.range ? ((this.p || this.s) && this.cl(this[this.p ? "p" : "s"].add(this.s)), this.bi("BOTH"), delete this.w[this._lastIndexOfFromDate], delete this.w[this._lastIndexOfToDate], this.q = this.s = this.n = this.p = this._lastIndexOfFromDate = this._lastIndexOfToDate = this.r = this.o = null, this.ay(), this.cp()) : (this.cl(this.l), this.l = this.m = null), this.dateInputNode.add(this.b).val("") }, setDate: function(t) { isNaN(Date.parse(t)) || this.ax(this.cr(t) ? t : new Date(Date.parse(t))) }, selectDate: function(t) { if (!isNaN(Date.parse(t)) && (t = this.cr(t) ? t : new Date(Date.parse(t)), this.ax(t, null, !0), this.c && this.c.length)) for (var e in this.c) if (this.ch(this.c[e].data("date"), t)) return this.c[e].click() }, selectRangeOfDate: function(t, e) { this.reset(); var i = this.bl(t, e); this.bs(this.bc(e), i, !0) && (this.t = !0, this.u = !1, this.selectDate(t), this.t = !1, this.u = !0, this.selectDate(e), this.hide()) }, setPos: function(t, e) { this.as(t, e) }, isHide: function() { return this.v }, isDisable: function(t) { return isNaN(Date.parse(t)) ? t : this.bp(new Date(Date.parse(t))) }, getPickerNodes: function() { return this.dateInputNode.add(this.b) }, getSelectedStartDate: function() { return this.n }, getSelectedEndDate: function() { return this.q }, getSelectedDate: function() { return this.m }, getCurrentDate: function() { return this.currentDate } }; var beatPickerIncrementalId = 0; initializeBitCal = function(t) { var e = t("*").filter(function() { return t(this).data("beatpicker") }); t(e).each(function() { var e = t(this), i = { dateInputNode: e }; t.extend(!0, i, _interpretExtraOptions(e), _interpretPosition(e), _interpretDisableRules(e), _interpretRange(e), _interpretDateFormat(e), _interpretDisablingModule(e)), _initialization(e, i) }) }, _initialization = function(t, e) { var i = t.data("beatpicker-id"); i ? window[i] = new BeatPicker(e) : (i = "beatpicker-" + beatPickerIncrementalId++, window[i] = new BeatPicker(e), t.attr("data-beatpicker-id", i)) }, _interpretDisableRules = function(t) { if (!(i = t.data("beatpicker-disable"))) return {}; t = []; var e, i = (i = (i = i.replace(/\s+/g, "")).split("}")).filter(function(t) { return "" !== t }); for (e in i) { var s = i[e] += "}"; 0 === s.indexOf(",") && (s = s.substr(1)), t.push(_parseJsonEngine(s, ["from", "to"])) } return { disablingRules: t } }, _interpretPosition = function(t) { return (t = t.data("beatpicker-position")) ? { view: { position: _parseJsonEngine(t, []) } } : {} }, _interpretRange = function(t) { if (void 0 === (t = t.data("beatpicker-range"))) return {}; var e = (t = (t = String(t)).replace(/\s+/g, "")).split(","); return { selectionRule: { range: t = "true" === e[0], rangeDisableSelect: "true" === e[1], single: !t } } }, _interpretDateFormat = function(t) { if (!(e = t.data("beatpicker-format"))) return {}; var e, i = (e = e.replace(/\s+/g, "")).indexOf("]"); return t = e.substr(0, i + 1), e = e.substr(i + 2, e.length), { dateFormat: jQuery.extend({ format: _parseJsonEngine(t, []) }, e ? _parseJsonEngine("{" + e + "}", ["separator"]) : { separator: "-" }) } }, _interpretExtraOptions = function(t) { return (t = t.data("beatpicker-extra")) && window[t] ? window[t] : null }, _interpretDisablingModule = function(t) { if (t = t.data("beatpicker-module")) { t = (t = t.replace(/\s+/g, "")).split(","); var e, i = { modules: {} }; for (e in t) i.modules[t[e]] = !1; return i } }, _parseJsonEngine = function(t, e) { for (var i in e) t = t.replace(e[i], '"' + e[i] + '"'); return "string" == typeof t ? JSON.parse(t.replace(/'/g, '"')) : t }; try { jQuery(document).ready(function(t) { initializeBitCal(t) }) } catch (t) { module && (module.exports = BeatPicker.prototype) }